home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / comm / net / AmiPhoneMiami.lha / Install_AmiPhone < prev    next >
Text File  |  1996-12-27  |  10KB  |  256 lines

  1. ; Installation script for AmiPhone
  2. ; by Jeremy Friesner
  3.  
  4. (transcript "On installing AmiPhone...")
  5.  
  6. (if (exists "AmiTCP:" (noreq))
  7.     (set defc 1)
  8.     (set defc 0)
  9. )
  10.  
  11. (set inst
  12.     (askchoice
  13.         (prompt "Select which TCP/IP-stack to install for")
  14.         (help "Short: Which package do you use to connect to internet with?")
  15.         (choices "Miami"
  16.                  "AmiTCP"
  17.         )
  18.         (default defc)
  19.     )
  20. )
  21.  
  22. (if inst
  23.     (
  24.         ; make sure "rx" is available
  25.         (if (not (exists "sys:rexxc/rx"))
  26.             (abort "This installer script needs to use the ARexx utility rx.\n\nPlease make sure the rx utility is installed in sys:rexxc and try to install again."))
  27.  
  28.         ; make sure we have the library that EditTextFile.rexx needs
  29.         (if (not (exists "libs:rexxsupport.library"))
  30.             (abort "This installer script needs rexxsupport.library in LIBS: to run.\n\nPlease install this library and then run this Installer script again."))
  31.  
  32.         ; try and make sure ARexx is running 
  33.         (run "rexxmast" (safe))
  34.     )
  35. )
  36.  
  37. ; if AmiPhoned is already in /serv, probably they've already installed before
  38. (set DefaultUpdate (exists "amitcp:serv/AmiPhoned" (noreq)))
  39.  
  40. ; don't want to make a distinction between 1 and 2
  41. (if (> DefaultUpdate 0)    (set DefaultUpdate 1))
  42.  
  43. (set PhoneUpdate
  44.       (askchoice
  45.          (prompt "Select which kind of install you want:")
  46.          (choices "First Time Install" "Update")
  47.          (default DefaultUpdate)
  48.          (help "If you've never installed AmiPhone on your system before, select First Time Install.  If you already have an earlier version, select Update.")
  49.    ))
  50.  
  51. ; see if we can't guess what digitizer they use, based on files in their system drawer    
  52. (set nGuessDefault 8)    ; default default is Generic
  53. (if (exists "devs:ahi.device") (set nGuessDefault 7))
  54. (if (exists "libs:toccata.library") (set nGuessDefault 3))
  55. (if (exists "libs:delfina.library") (set nGuessDefault 6))
  56.  
  57. ; ask the user what kind of digitizer they use
  58. (set Digitizer
  59.       (askchoice
  60.            (prompt "Select which type of audio digitizer you will be using with AmiPhone:")
  61.            (choices "GVP DSS8" "PerfectSound" "A.M.A.S." "Toccata (Zorro II)" "Aura (PCMCIA)" "Sound Magic" "Delfina (Zorro II)" "AHI (Audio Library)" "Generic Parallel Port digitizer")
  62.            (default nGuessDefault)
  63.            (help "To send speech with AmiPhone, you need an audio digitizer connected to your parallel port.  If your digitizer model is not listed, please choose the Generic option.")
  64.       )
  65. )
  66. (select Digitizer
  67.     (set Digitizer "DSS8")
  68.     (set Digitizer "PERFECTSOUND")
  69.     (set Digitizer "AMAS")
  70.     (set Digitizer "TOCCATA")
  71.     (set Digitizer "AURA")
  72.     (set Digitizer "SOUNDMAGIC")
  73.     (set Digitizer "DELFINA")
  74.     (set Digitizer "AHI")
  75.     (set Digitizer "GENERIC")
  76. )
  77. (tooltype
  78.     (dest "AmiPhone")
  79.     (settooltype "SAMPLER" Digitizer)
  80. )
  81.  
  82. ; do they want to set up AmiPhone to receive voice-mail?
  83. (if (= 1 (askbool 
  84.     (prompt "\n\nDo you wish to set up AmiPhone to receive voice mail?")
  85.     (help "AmiPhone is capable of receiving and storing voice messages while you are away from your computer.  This takes some disk space though, so if you're tight on space, you might want to leave it disabled.")
  86.     (default 0)
  87.     (choices "Yes" "No")))
  88. ; answered yes
  89. (
  90.     (set MessageDir 
  91.         (askdir
  92.                     (prompt "What directory would you like AmiPhone to keep the voice message files in?  (NOTE: You should not keep any other files in this directory!)")
  93.                         (help @askdir-help)
  94.                         (default "work:")))
  95.             (set MaxDirSize
  96.                 (asknumber
  97.                     (prompt "\n\nWhat should be the maximum possible size (in kilobytes) of this directory be?  (Enter -1 for unlimited size)")
  98.                     (help "By setting this value, you can guarantee that AmiPhoned will not let anyone fill up your hard drive.  AmiPhoned counts the bytes in the voice mail directory on startup, and will reject messages if the directory size has reached the size you specify here.")
  99.             (default 500)
  100.             (range -1 1000000)))
  101.     
  102.     ; if a max size was set for the dir, use that as the max max file size as well
  103.     (if (> MaxDirSize -1)
  104.         (set MaxFileSize MaxDirSize)
  105.         (set MaxFileSize 1000000))
  106.     
  107.     (set MaxFileSize
  108.         (asknumber
  109.             (prompt "\n\nWhat should the maximum possible size (in kilobytes) of each message be?  (Enter -1 to impose no special limit on individual message size)")
  110.                     (help "By setting this value, you can guarantee that no one message will fill up your entire allotment of message space.")
  111.             (default -1)
  112.             (range -1 MaxFileSize)))
  113.             (set AwayVar
  114.                 (askstring
  115.                     (prompt "\n\nAmiPhone uses the presence of an ENV: var to determine whether or not you're away.  If the ENV: var is present, it takes a message, otherwise it puts up a requester for you.  What ENV: var would you like AmiPhone to look for?")
  116.                     (help "The ENV: var can be set manually by you, by a script, or perhaps by your screen blanker.")
  117.             (default "BLANKED")))
  118.     
  119.     ; set the tooltypes!    
  120.     (set BlankString "")
  121.  
  122.     (tooltype
  123.         (dest "AmiPhone")
  124.         (settooltype "VOICEMAILDIR" MessageDir))
  125.     (tooltype
  126.         (dest "AmiPhone")
  127.         (settooltype "AWAYVAR" AwayVar))
  128.  
  129.     (if (> MaxDirSize -1)
  130.     ((tooltype
  131.         (dest "AmiPhone")
  132.         (settooltype "MAXVOICEMAILSIZE" (cat BlankString MaxDirSize))))
  133.     ;else
  134.     ((tooltype (dest "AmiPhone") (settooltype "MAXVOICEMAILSIZE"))))
  135.     
  136.     (if (> MaxFileSize -1)    
  137.     ((tooltype
  138.         (dest "AmiPhone")
  139.         (settooltype "MAXMESSAGESIZE" (cat BlankString MaxFileSize))))
  140.     ;else
  141.     ((tooltype (dest "AmiPhone") (settooltype "MAXMESSAGESIZE"))))
  142.     
  143. )
  144. ; answered no
  145. (
  146.     ; clean out any related tooltypes 
  147.     (tooltype (dest "AmiPhone") (settooltype "VOICEMAILDIR"))
  148.     (tooltype (dest "AmiPhone") (settooltype "MAXVOICEMAILSIZE"))
  149.     (tooltype (dest "AmiPhone") (settooltype "MAXMESSAGESIZE"))
  150.     (tooltype (dest "AmiPhone") (settooltype "AWAYVAR"))
  151. ))
  152.  
  153. (set PhoneDir
  154.     (askdir
  155.         (prompt "What directory would you like to put the AmiPhone executable in?\n(no directory will be created)")
  156.         (help @askdir-help)
  157.         (default (select inst "Work:" "AmiTCP:bin") )
  158.     )
  159. )
  160.  
  161. (set @default-dest PhoneDir)
  162.  
  163. (if inst
  164.     (set PhonedDir "AmiTCP:Serv")
  165.     (
  166.         (set PhonedDir
  167.             (askdir
  168.                 (prompt "What directory would you like to put the AmiPhoned daemon executable in?\n(no directory will be created)")
  169.                 (help @askdir-help)
  170.                 (default "Work:")
  171.             )
  172.         )
  173.     )
  174. )
  175. ; if PhoneDir isn't the usual, set the AMIPHONE env: var to let AmiPhoned know
  176. (if (not (PatMatch "Amitcp:bin" PhoneDir))
  177.    (
  178.     (run (cat "echo " (tackon PhoneDir "AmiPhone") " >env:AMIPHONE"))
  179.     (run (cat "echo " (tackon PhoneDir "AmiPhone") " >envarc:AMIPHONE"))
  180.    )
  181. )
  182.  
  183. ; Copy AmiPhone and AmiPhoned to the bin and serv directories 
  184. (copyfiles
  185.     (prompt (cat "Copying AmiPhone executable to " PhoneDir))
  186.     (help @copyfiles-help)
  187.     (source "")
  188.     (infos)
  189.     (pattern "AmiPhone")
  190.     (dest PhoneDir)
  191. )
  192.  
  193. (copyfiles
  194.     (prompt (cat "Copying AmiPhoned daemon to %s" PhonedDir) )
  195.     (help @copyfiles-help)
  196.     (source "")
  197.     (infos)
  198.     (pattern "AmiPhoned")
  199.     (dest PhonedDir)
  200. )
  201.  
  202. ; If we're doing a first-time install, update the user's AmiTCP config files
  203. (if (= 0 PhoneUpdate)    
  204.     (if inst
  205.         (
  206.             (delete "t:edit_text_succeeded")
  207.             (set ARexxRunString (cat "sys:rexxc/rx EditTextFile.rexx amitcp:db/services AmiPhone AmiPhone^^^^^^^^2956/tcp"))
  208.             (run
  209.                 (ARexxRunString)
  210.                 (prompt "If you plan to be running AmiPhone in conjunction with AmiTCP, the line:\n\nAmiPhone        2956/tcp\n\nneeds to be present in your amitcp:db/services file.  Do you wish me to update the file?  (Note:  AmiPhone will not receive connections if this line is not precisely as shown above!)")
  211.                 (help "The inclusion of this line into amitcp:db/services is done by an ARexx script which is smart enough to correctly edit previous installations.  Also it will make a backup (to amitcp:db/services.bak) before writing.")
  212.                 (confirm)
  213.             )
  214.             (if (not (exists "t:edit_text_succeeded"))
  215.                (message "For some reason, the config file editing script (EditText.rexx) could not complete successfully.  You'll need to edit your amitcp:db/services file yourself.  Look in the 'Installation' section of the AmiPhone docs for instructions."))
  216.                         
  217.             (delete "t:edit_text_succeeded")
  218.             (set ARexxRunString (cat "sys:rexxc/rx EditTextFile.rexx amitcp:db/inetd.conf AmiPhone AmiPhone^^^^stream^^^^^^tcp^nowait^root^^^^amitcp:serv/AmiPhoned"))
  219.             (run
  220.                 (ARexxRunString)
  221.                 (prompt "\nAlso, the line:\n\nAmiPhone    stream      tcp nowait root    amitcp:serv/AmiPhoned\n\nneeds to be present in your amitcp:db/inetd.conf file.  Do you wish me to update that file?\n(Note:  AmiPhone will not receive connections if this line is not precisely as shown above!)")
  222.                 (help "The inclusion of this line into amitcp:db/inetd.conf is done by an ARexx script which is smart enough to correctly edit previous installations.  Also it will make a backup (to amitcp:db/inetd.conf.bak) before writing.")
  223.                 (confirm)
  224.             )
  225.             (if (not (exists "t:edit_text_succeeded"))
  226.                (message "For some reason, the config file editing script (EditText.rexx) could not complete successfully.  You'll need to edit your amitcp:db/inetd.conf file yourself.  Look in the 'Installation' section of the AmiPhone docs for instructions."))
  227.         )
  228.  
  229.         (
  230.             ; Create the textfile with a pointer to AmiPhoneD
  231.             (textfile
  232.                (dest "t:dbtemp")
  233.                (append
  234.                   "ADD services AmiPhone 2956/tcp\n"
  235.                   ("ADD inetd AmiPhone stream tcp nowait root %s\n" (tackon PhonedDir "AmiPhoned") )
  236.                )
  237.             )
  238.  
  239.             ; Add the lines to envarc:MiamiChangeDB (i.e. don't overwrite! Other programs
  240.             ; may have their lines there too)
  241.             (run "type t:dbtemp >>envarc:MiamiChangeDB")
  242.  
  243.             ; If Miami shoule be running... why not make it read the new settings?
  244.             (run "SYS:Rexxc/RX \"ADDRESS MIAMI.1;changedb\"")
  245.  
  246.             ; Clean up
  247.             (delete "t:dbtemp")
  248.         )    
  249.  
  250.     )
  251. )
  252. (if inst
  253.     (message "\n\nAmiPhone is now installed.\nRe-start AmiTCP and try it out!")
  254.     (message "\n\nAmiPhone is now installed.\nYou may have to re-start Miami before you start AmiPhone!")
  255. )
  256.